/*
 * @Author: wuqingchun
 * @Date: 2024-10-22 13:26:28
 * @Description: 
 * @LastEditors: wuqingchun
 * @LastEditTime: 2024-10-22 13:39:07
 */

#include <iostream>

class CIntArray
{
public:
    CIntArray()
    {
        for (int i = 0; i < 100; i++)
        {
            m_aiValue[i] = i;
        }
    }
    template <typename FUNC_TYPE>
    void foreach(FUNC_TYPE func)
    {
        for (int i = 0; i < 100; i++)
        {
            if (func(m_aiValue[i]))
            {
                break;
            }
        }
    }

private:
    int m_aiValue[100];
};

int main(int argc, char** argv)
{
    CIntArray objArray;

    objArray.foreach([](int iVal)->bool {
        std::cout << iVal << std::endl;
        return true;
    });

    return 0;
}